home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / WRITEFC.CA < prev    next >
Text File  |  1993-04-04  |  1KB  |  54 lines

  1. #include <dos.h>
  2. writefc(int row, int col, int attr, char mch)
  3. /* This will do a direct video write of the character ch. It will be
  4.    placed at location row,col using attribute attr.
  5. */
  6. {
  7.   extern int color, mono, cga, ega, scrseg, bios;
  8.   int   scrofs, *pattr, orow, ocol ,x;
  9.   char pchar;
  10.   char far *base;
  11.   char far *work;
  12.     if(mono) base=(char far *)0xb0000000;
  13.     else base=(char far *)0xb8000000;
  14.     if(bios) {
  15.           get_cur(&orow,&ocol);
  16.         locate(row,col) ;
  17.         put_ca(mch,attr,1);
  18.         cur_rt();
  19.         locate(orow,ocol);
  20.         return(0);
  21.     }
  22.     scrofs = ((((row+1) * 160) - 160) + ((col+1) * 2)) - 2;
  23.     work = base + scrofs;
  24.     pchar = mch;
  25.     asm les bx,work
  26.     asm mov cl,pchar
  27.     if(cga) {
  28.             asm     mov    dx,03dah
  29.             asm        in    al,dx
  30.             asm        test al,1
  31.             asm        jnz $-3
  32.             asm        in    al,dx
  33.             asm        test al,1
  34.             asm        jz $-3
  35.         }
  36.         asm mov byte ptr es:[bx],cl
  37.     work++;
  38.     pchar = attr;
  39.     asm les bx,work
  40.     asm mov cl,pchar
  41.     if(cga) {
  42.             asm     mov    dx,03dah
  43.             asm        in    al,dx
  44.             asm        test al,1
  45.             asm        jnz $-3
  46.             asm        in    al,dx
  47.             asm        test al,1
  48.             asm        jz $-3
  49.         }
  50.         asm mov byte ptr es:[bx],cl
  51.     work++;
  52.     return(0);
  53. }
  54.